package com.management.controller;

import com.management.po.Student;
import com.management.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/StudentController")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @PostMapping("/saveStudent")
    public int saveStudent(Student student){
        return studentService.saveStudent(student);
    }

    @GetMapping("/getStudentById")
    public Student getStudentById(String studentId){
        return studentService.getStudentById(studentId);
    }

    @DeleteMapping("/deleteStudentById")
    public int deleteStudentById(String studentId){
        return studentService.deleteStudentById(studentId);
    }

}
